package com.njust.RateMyTray_backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njust.RateMyTray_backend.entity.Tag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TagMapper extends BaseMapper<Tag> {

    @Select("SELECT t.tag_name FROM t_tag t " +
            "JOIN t_dish_tag dt ON t.id = dt.tag_id " +
            "WHERE dt.dish_id = #{dishId}")
    List<String> findTagNamesByDishId(@Param("dishId") Long dishId);
} 